<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<!-- header -->
		<%@ include file="/WEB-INF/views/include/header.jsp"%>
	</head>
	<style>
		#force{
			position: absolute;
			width: 100%;
			background-color: #fff;
			z-index: 9;
			display: none;
		}
		#forceTiShi{
			position: absolute;
			width: 50%;
			height: 50%;
			background: #bfe;
			left: 50%; top: 50%;
			transform: translate(-50%, -50%);
		}
	</style>
	<div id="force">
		<div id="forceTiShi">
			<h3 class="text-center">由于您的浏览器版本过低,无法使用,请更换浏览器。</h3>
			<h3 class="text-center text-danger">如果是360浏览器其他浏览器请切换极速模式。</h3>
			<h3 class="text-center text-danger"><a href="https://jingyan.baidu.com/article/63acb44a1aeb8a61fdc17e4c.html">切换极速模式教程</a></h3>
			<h3 class="text-center">已经为你提供最佳浏览器,请点击下载。</h3>
			<h3 class="text-center">请点击下载<span style="color:#049CE6;cursor: pointer" onclick="window.open('login/downChrome');">(谷歌浏览器)</span></h3>
		</div>
	</div>
	<body class="login-layout blur-login">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">
							<div class="center">
								<h1>
									<i class="ace-icon fa fa-leaf green"></i>
									<span class="red">永泰县</span>
									<span class="white" id="id-text2">督查管理系统</span>
								</h1>
								<h4 class="blue" id="id-company-text">&copy; 政信云</h4>
							</div>

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="ace-icon fa fa-coffee green"></i>
												<c:if test="${empty error }">
													请输入你的登陆信息
												</c:if>
												<c:if test="${!empty error }">
													${error }
												</c:if>
											</h4>

											<div class="space-6"></div>

											<form action="<s:url value="/login"></s:url>" id="form" method="post">
												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" name="username" class="form-control" placeholder="请输入账号 " />
															<i class="ace-icon fa fa-user"></i>
														</span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<%--<input type="password" name="password" class="form-control" placeholder="请输入密码" />--%>
															<input type="password" name="password" class="form-control" placeholder="请输入密码" />
															<i class="ace-icon fa fa-lock"></i>
														</span>
													</label>

													<div class="clearfix">
														<button type="button" id="loginBtn" class="width-35 pull-right btn btn-sm btn-primary">
															<i class="ace-icon fa fa-key"></i>
															<span class="bigger-110">登陆</span>
														</button>
													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>

										</div><!-- /.widget-main -->

										<div class="toolbar clearfix">
											<div><!-- 占位符 --></div>
										</div>
									</div><!-- /.widget-body -->
								</div><!-- /.login-box -->
							</div><!-- /.position-relative -->
								
								

						
							
							<%--<div class="navbar-fixed-top align-right">--%>
								<%--<br />--%>
								<%--<a>主题切换：</a>--%>
								<%--&nbsp;--%>
								<%--<a id="btn-login-dark" href="#">黑色</a>--%>
								<%--&nbsp;--%>
								<%--<span class="blue">/</span>--%>
								<%--&nbsp;--%>
								<%--<a id="btn-login-blur" href="#">蓝色</a>--%>
								<%--&nbsp;--%>
								<%--<span class="blue">/</span>--%>
								<%--&nbsp;--%>
								<%--<a id="btn-login-light" href="#">白色</a>--%>
								<%--&nbsp; &nbsp; &nbsp;--%>
							<%--</div>--%>
						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='<s:url value="/assets/js/jquery.js"></s:url>'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->

		<!--[if IE]>
		<script type="text/javascript">
			window.jQuery || document.write("<script src='<s:url value="/assets/js/jquery1x.js"></s:url>'>"+"<"+"/script>");
		</script>
		<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='<s:url value="/assets/js/jquery.mobile.custom.js"></s:url>'>"+"<"+"/script>");
		</script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
			$(function () {
				// var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
				// if (!((userAgent.indexOf("Firefox") > -1)||(userAgent.indexOf("Chrome") > -1)) ) {
				// 	document.getElementById("force").style.display = "block";
				// }
                var Sys = {};
                var ua = navigator.userAgent.toLowerCase();
                var re = /(msie|firefox|chrome|opera|version).*?([\d.]+)/;
                var m = ua.match(re);
                try{
                    Sys.browser = m[1].replace(/version/, "'safari");
                    Sys.ver = m[2];
                }catch(e)
                {
                    console.log("getBrowserInfo fail.")
                }

                //	获取当前显示高度
                var KJHeight = document.documentElement.clientHeight;
                document.getElementById("force").style.height = KJHeight + "px";
			});

			//you don't need this, just used for changing background
			jQuery(function($) {
				$('#btn-login-dark').on('click', function(e) {
					$('body').attr('class', 'login-layout');
					$('#id-text2').attr('class', 'white');
					$('#id-company-text').attr('class', 'blue');

					e.preventDefault();
				});
				$('#btn-login-light').on('click', function(e) {
					$('body').attr('class', 'login-layout light-login');
					$('#id-text2').attr('class', 'grey');
					$('#id-company-text').attr('class', 'blue');

					e.preventDefault();
				});
				$('#btn-login-blur').on('click', function(e) {
					$('body').attr('class', 'login-layout blur-login');
					$('#id-text2').attr('class', 'white');
					$('#id-company-text').attr('class', 'light-blue');

					e.preventDefault();
				});

			});


			$("#loginBtn").click(function(){
				$("#form").submit();
			});



			$("input[name=password]").bind('keyup', function(event) {
				var keyCode = event.keyCode;
				if(keyCode == 13) {
					$("#form").submit();
				}
			});
			
			$("#emailBtn").click(function() {
				var email = $("#email").val();
				var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
				if(reg.test(email)) {
					$.post("<s:url value="/api/sys/user/searchPassword"/>", { email: email},
					function(data){
				    	if(data.code == "200") {
							$("#email_msg").text('重置密码的邮件已经发到您的邮箱“'+email+'”中，请查收');
				    	} else {
				    		$("#email_msg").text(data.message);
				    	}
				   	});
				} else {
					$("#email_msg").text('请输入正确的邮箱格式');
				}
			});


		</script>
	</body>
</html>